#ifndef _PREFIXEXPRESSION_HPP
#define _PREFIXEXPRESSION_HPP

#include <string>
#include "Expression.hpp"
#include "Token.hpp"

namespace ast {

	class PrefixExpression : public Expression {
	public:
		PrefixExpression(TOKEN token, string op) {
			_token = token;
			_operator = op;
		}

		virtual void ExpressionNode() override {

		}

		virtual string tokenLiteral() override {
			return _token._literal;
		}

		virtual string String() override {
			string out;
			out.append("(");
			out.append(_token._literal);
			if (_right != nullptr) {
				out.append(_right->String());
			}
			out.append(")");
			return out;
		}

		virtual ~PrefixExpression() {
			if (_right != nullptr) {
				delete _right;
			}
		}

	public:
		TOKEN _token;
		string _operator;
		Expression* _right{ nullptr };
	};
}

#endif // !_INTEGERLITERAL_HPP
